﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_FIM_MAS_Banks : IBLL_FIM_MAS_Banks
    {
        Common common = new Common();
        private static readonly IDAL_FIM_MAS_Banks dal = DataAccess.Create_FIM_MAS_Banks();

        public B_FIM_MAS_Banks()
        {

        }

        public IList<M_FIM_MAS_Banks> GetFull()
        {
            return dal.GetFull();
        }

        public IList<M_FIM_MAS_Banks> GetList()
        {
            return dal.GetList();
        }

        public M_FIM_MAS_Banks GetInfo(string seq)
        {
            int nSeq;
 
            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }

        public M_FIM_MAS_Banks GetBankNamePaymentCheques(int? pay_seq) {
            return dal.GetBankNamePaymentCheques(pay_seq);
        }

        //public string SelectRecentInsertedRoleSeq()
        //{
        //    try
        //    {
        //        return dal.SelectRecentInsertedRoleSeq();
        //    }
        //    catch
        //    {
        //        throw;
        //    }
        //}

        public string Insert(M_FIM_MAS_Banks info)
        {
            try
            {
                return dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Update(M_FIM_MAS_Banks info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(M_FIM_MAS_Banks info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }
    }
}
